Package com.cisco.pt.ipc.sim.impl
Class DirectoryImpl
java.lang.Object
com.cisco.pt.ipc.impl.IPCObjectImpl
com.cisco.pt.ipc.sim.impl.SimFileImpl
com.cisco.pt.ipc.sim.impl.DirectoryImpl
- Direct Known Subclasses:
FileSystemImpl
Information provided by the PKI file:
\class Directory
\brief Directory is the directory of the file systems for routers and switches.
\example network().getDevice("Router0").getProcess("FileManager").getFileSystem("flash:")
- Author:
- Auto-generated
-
Field Summary
Fields inherited from class com.cisco.pt.ipc.impl.IPCObjectImpl
accessMessage, ipcFactory, packetTracerSession -
Constructor Summary
ConstructorsConstructorDescriptionDirectoryImpl(IPCFactory ipcFactory, PacketTracerSession packetTracerSession, IPCMessageLTV accessMessage) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDirectory(String name, boolean bCheckPermission) Information provided by the PKI file:booleanaddHttpPage(String name, String content, boolean bCheckPermission) Information provided by the PKI file:booleanaddTextFile(String name, String content, boolean bCheckPermission) Information provided by the PKI file:booleanInformation provided by the PKI file:Information provided by the PKI file:getFileAt(int index) Information provided by the PKI file:intInformation provided by the PKI file:intInformation provided by the PKI file:booleanremoveAllFiles(boolean bCheckPermission) Information provided by the PKI file:booleanremoveFile(String name, boolean bCheckPermission) Information provided by the PKI file:booleanrenameFile(String oldName, String newName, boolean bCheckPermission) Information provided by the PKI file:Methods inherited from class com.cisco.pt.ipc.sim.impl.SimFileImpl
getAbsPath, getContent, getName, getParent, getPermission, getSize, isDirectory, isExecutable, isReadable, isWritable, setTextContentMethods inherited from class com.cisco.pt.ipc.impl.IPCObjectImpl
getAccessMessage, getClassName, getFactory, getObjectUUID, getPacketTracerSession, sendMessage, sendMessageWithReturn, translateToCommandStatusStringPairMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cisco.pt.ipc.IPCObject
getAccessMessage, getClassName, getFactory, getObjectUUID, getPacketTracerSessionMethods inherited from interface com.cisco.pt.ipc.sim.SimFile
getAbsPath, getContent, getName, getParent, getPermission, getSize, isDirectory, isExecutable, isReadable, isWritable, setTextContent
-
Constructor Details
-
DirectoryImpl
public DirectoryImpl(IPCFactory ipcFactory, PacketTracerSession packetTracerSession, IPCMessageLTV accessMessage)
-
-
Method Details
-
getFileCount
public int getFileCount()Information provided by the PKI file:
\brief Returns the number of files in the file system. \return int, the number of files in the file system.- Specified by:
getFileCountin interfaceDirectory- Returns:
- int Returns a int
-
getFileAt
Information provided by the PKI file:
\brief Returns the file at the specified index. \param index, the index of the file of interest. \return SimFile, the SimFile object at the specified index. -
getFile
Information provided by the PKI file:
\brief Returns the file with the specified filename. \param filename, the filename of the file. \return SimFile, the SimFile object with the associated filename. -
fileExist
Information provided by the PKI file:
\brief Returns if a file exist in the file system \param name, file name \return bool, true if exists and false if not -
getSpaceUsed
public int getSpaceUsed()Information provided by the PKI file:
\brief Returns the amount of space used on this file system. \return int, the amount of space used on this file system.- Specified by:
getSpaceUsedin interfaceDirectory- Returns:
- int Returns a int
-
addTextFile
Information provided by the PKI file:
\brief Add text file into filesystem \param name, SimFile name \param content, file content \param bCheckPermission, true if write permission needs to be checked and false if otherwise \return bool, true if the file was added successfully and false if not- Specified by:
addTextFilein interfaceDirectory- Parameters:
name- Takes in a parameter of namecontent- Takes in a parameter of contentbCheckPermission- Takes in a parameter of bCheckPermission- Returns:
- boolean Returns a boolean
-
addDirectory
Information provided by the PKI file:
\brief Add directory into filesystem \param name, Directory name \param bCheckPermission, true if write permission needs to be checked and false if otherwise \return bool, true if the file was added successfully and false if not- Specified by:
addDirectoryin interfaceDirectory- Parameters:
name- Takes in a parameter of namebCheckPermission- Takes in a parameter of bCheckPermission- Returns:
- boolean Returns a boolean
-
addHttpPage
Information provided by the PKI file:
\brief Returns true if the HTTP page was added successfully, false otherwise. \param name, the name of the HTTP page. \param content, the content of the HTTP page. \param bCheckPermission, true to check permissions, false to skip. \return bool, true if the HTTP page was added successfully, false otherwise.- Specified by:
addHttpPagein interfaceDirectory- Parameters:
name- Takes in a parameter of namecontent- Takes in a parameter of contentbCheckPermission- Takes in a parameter of bCheckPermission- Returns:
- boolean Returns a boolean
-
removeFile
Information provided by the PKI file:
\brief Returns true if the file was removed successfully, false otherwise. \param name, the name of the file of interest. \param bCheckPermission, true to check permissions, false to skip. \return bool, true if the file was removed successfully, false otherwise.- Specified by:
removeFilein interfaceDirectory- Parameters:
name- Takes in a parameter of namebCheckPermission- Takes in a parameter of bCheckPermission- Returns:
- boolean Returns a boolean
-
removeAllFiles
public boolean removeAllFiles(boolean bCheckPermission) Information provided by the PKI file:
\brief Returns true if all files were removed successfully, false otherwise. \param bCheckPermission, true to check permissions, false to skip. \return bool, true if all files were removed successfully, false otherwise.- Specified by:
removeAllFilesin interfaceDirectory- Parameters:
bCheckPermission- Takes in a parameter of bCheckPermission- Returns:
- boolean Returns a boolean
-
renameFile
Information provided by the PKI file:
\brief Returns true if the file was renamed successfully, false otherwise. \param oldName, the old file name \param newName, the new file name. \param bCheckPermission, true to check permissions, false to skip. \return bool, true if the file was renamed successfully, false otherwise.- Specified by:
renameFilein interfaceDirectory- Parameters:
oldName- Takes in a parameter of oldNamenewName- Takes in a parameter of newNamebCheckPermission- Takes in a parameter of bCheckPermission- Returns:
- boolean Returns a boolean
-